package com.leaf.u_spring.chapter12;

import java.util.Collection;
import java.util.LinkedHashSet;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * Spring Data MongoDB注解将Java类型映射为文档
 */
@Document		//这是一个文档
public class Order {

	@Id		//指定id
	private String id;
	
	@Field("client")		//覆盖默认的域名
	private String customer;
	
	private String type;
	
	private Collection<Item> items = new LinkedHashSet<>();

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Collection<Item> getItems() {
		return items;
	}

	public void setItems(Collection<Item> items) {
		this.items = items;
	}
	
	
	
}
